package com.rent.auth.pojo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.rent.auth.model.RolePermission;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @version 1.0
 * @Author zn
 * @create 2023/8/22 11:39
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Setter
@Getter
public class AdminExtension extends User implements Serializable {

    @ApiModelProperty(value = "账户ID")
    private Integer id;

    @ApiModelProperty(value = "租户编码")
    private String tenant;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "用户角色")
    private Integer roleId;

    @ApiModelProperty(value = "权限资源列表")
    private List<RolePermission> permissionList;


    @ApiModelProperty(value = "用户状态")
    private Integer status;

    // 继承父类构造方法
    public AdminExtension(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

}
